<template>
  <view class="order-record-page">
    <!-- 头部标题 -->
    <view class="header">
      <text class="title">订单记录</text>
    </view>
    
    <!-- 时间轴内容 -->
    <view class="timeline">
      <!-- 遍历状态列表，渲染每一条订单状态 -->
      <view class="timeline-item" v-for="(item, index) in orderStatus" :key="index">
        <view class="timeline-icon"></view>
        <view class="timeline-content">
          <view class="status">{{ item.status }}</view>
          <view class="time">{{ item.time }}</view>
          <view class="desc">{{ item.desc }}</view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      // 模拟订单状态的数据
      orderStatus: [
        { status: '等待接单中…', time: '2023-12-25 08:26', desc: '请您耐心等待，我们尽快催促师傅接单' },
        { status: '订单已生成', time: '2023-12-25 08:26', desc: '请您耐心等待，我们尽快催促师傅接单' }
      ]
    }
  },
  onLoad(options) {
    // 如果有其他页面传递的订单ID或其他数据，可以通过 options 进行处理
    // 示例： this.orderId = options.orderId;
  }
}
</script>

<style scoped>
.order-record-page {
  padding: 20px;
  background-color: #fff;
}

.header {
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.title {
  font-size: 20px;
  font-weight: bold;
}

.timeline {
  margin-top: 20px;
}

.timeline-item {
  display: flex;
  margin-bottom: 20px;
  position: relative;
}

.timeline-icon {
  width: 12px;
  height: 12px;
  background-color: #007aff;
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 5px;
}

.timeline-content {
  margin-left: 25px;
}

.status {
  font-size: 16px;
  font-weight: bold;
}

.time {
  font-size: 14px;
  color: #999;
  margin-top: 5px;
}

.desc {
  font-size: 14px;
  color: #666;
  margin-top: 5px;
}
</style>
